home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / PInterfaces / Slots.p < prev    next >
Encoding:
Text File  |  1992-01-29  |  9.2 KB  |  262 lines  |  [TEXT/MPS ]

  1.  
  2. {
  3. Created: Monday, September 16, 1991 at 12:57 AM
  4.  Slots.p
  5.  Pascal Interface to the Macintosh Libraries
  6.  
  7.   Copyright Apple Computer, Inc. 1986-1991
  8.   All rights reserved
  9. }
  10.  
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.  UNIT Slots;
  18.  INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingSlots}
  22. {$SETC UsingSlots := 1}
  23.  
  24. {$I+}
  25. {$SETC SlotsIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingTypes}
  28. {$I $$Shell(PInterfaces)Types.p}
  29. {$ENDC}
  30. {$IFC UNDEFINED UsingOSEvents}
  31. {$I $$Shell(PInterfaces)OSEvents.p}
  32. {$ENDC}
  33. {$IFC UNDEFINED UsingOSUtils}
  34. {$I $$Shell(PInterfaces)OSUtils.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED UsingFiles}
  37. {$I $$Shell(PInterfaces)Files.p}
  38. {$ENDC}
  39. {$SETC UsingIncludes := SlotsIncludes}
  40.  
  41. CONST
  42. fCardIsChanged = 1;                                    {Card is Changed field in StatusFlags field of sInfoArray}
  43. fCkForSame = 0;                                        {For SearchSRT. Flag to check for SAME sResource in the table. }
  44. fCkForNext = 1;                                        {For SearchSRT. Flag to check for NEXT sResource in the table. }
  45. fWarmStart = 2;                                        {If this bit is set then warm start else cold start.}
  46.  
  47. stateNil = 0;                                        {State}
  48. stateSDMInit = 1;                                    {:Slot declaration manager Init}
  49. statePRAMInit = 2;                                    {:sPRAM record init}
  50. statePInit = 3;                                        {:Primary init}
  51. stateSInit = 4;                                        {:Secondary init}
  52.  
  53. { flags for spParamData }
  54. fall = 0;                                            { bit 0: set=search enabled/disabled sRsrc's }
  55. foneslot = 1;                                        {    1: set=search sRsrc's in given slot only }
  56. fnext = 2;                                            {    2: set=search for next sRsrc }
  57.  
  58. TYPE
  59. SQElemPtr = ^SlotIntQElement;
  60. SlotIntQElement = RECORD
  61.  sqLink: Ptr;                                        {ptr to next element}
  62.  sqType: INTEGER;                                    {queue type ID for validity}
  63.  sqPrio: INTEGER;                                    {priority}
  64.  sqAddr: ProcPtr;                                    {interrupt service routine}
  65.  sqParm: LONGINT;                                    {optional A1 parameter}
  66.  END;
  67.  
  68. SpBlockPtr = ^SpBlock;
  69. SpBlock = PACKED RECORD
  70.  spResult: LONGINT;                                    {FUNCTION Result}
  71.  spsPointer: Ptr;                                    {structure pointer}
  72.  spSize: LONGINT;                                    {size of structure}
  73.  spOffsetData: LONGINT;                                {offset/data field used by sOffsetData}
  74.  spIOFileName: Ptr;                                    {ptr to IOFile name for sDisDrvrName}
  75.  spsExecPBlk: Ptr;                                    {pointer to sExec parameter block.}
  76.  spParamData: LONGINT;                                {misc parameter data (formerly spStackPtr).}
  77.  spMisc: LONGINT;                                    {misc field for SDM.}
  78.  spReserved: LONGINT;                                {reserved for future expansion}
  79.  spIOReserved: INTEGER;                                {Reserved field of Slot Resource Table}
  80.  spRefNum: INTEGER;                                    {RefNum}
  81.  spCategory: INTEGER;                                {sType: Category}
  82.  spCType: INTEGER;                                    {Type}
  83.  spDrvrSW: INTEGER;                                    {DrvrSW}
  84.  spDrvrHW: INTEGER;                                    {DrvrHW}
  85.  spTBMask: SignedByte;                                {type bit mask bits 0..3 mask words 0..3}
  86.  spSlot: SignedByte;                                {slot number}
  87.  spID: SignedByte;                                    {structure ID}
  88.  spExtDev: SignedByte;                                {ID of the external device}
  89.  spHwDev: SignedByte;                                {Id of the hardware device.}
  90.  spByteLanes: SignedByte;                            {bytelanes from card ROM format block}
  91.  spFlags: SignedByte;                                {standard flags}
  92.  spKey: SignedByte;                                    {Internal use only}
  93.  END;
  94.  
  95. SInfoRecPtr = ^SInfoRecord;
  96. SInfoRecord = PACKED RECORD
  97.  siDirPtr: Ptr;                                        {Pointer to directory}
  98.  siInitStatusA: INTEGER;                            {initialization E}
  99.  siInitStatusV: INTEGER;                            {status returned by vendor init code}
  100.  siState: SignedByte;                                {initialization state}
  101.  siCPUByteLanes: SignedByte;                        {0=[d0..d7] 1=[d8..d15]}
  102.  siTopOfROM: SignedByte;                            {Top of ROM= $FssFFFFx: x is TopOfROM}
  103.  siStatusFlags: SignedByte;                            {bit 0 - card is changed}
  104.  siTOConst: INTEGER;                                {Time Out C for BusErr}
  105.  siReserved: PACKED ARRAY [0..1] OF SignedByte;        {reserved}
  106.  siROMAddr: Ptr;                                    { addr of top of ROM }
  107.  siSlot: CHAR;                                        { slot number }
  108.  siPadding: PACKED ARRAY [0..2] OF SignedByte;        { reserved }
  109.  END;
  110.  
  111. SDMRecord = PACKED RECORD
  112.  sdBEVSave: ProcPtr;                                {Save old BusErr vector}
  113.  sdBusErrProc: ProcPtr;                                {Go here to determine if it is a BusErr}
  114.  sdErrorEntry: ProcPtr;                                {Go here if BusErrProc finds real BusErr}
  115.  sdReserved: LONGINT;                                {Reserved}
  116.  END;
  117.  
  118. FHeaderRecPtr = ^FHeaderRec;
  119. FHeaderRec = PACKED RECORD
  120.  fhDirOffset: LONGINT;                                {offset to directory}
  121.  fhLength: LONGINT;                                    {length of ROM}
  122.  fhCRC: LONGINT;                                    {CRC}
  123.  fhROMRev: SignedByte;                                {revision of ROM}
  124.  fhFormat: SignedByte;                                {format - 2}
  125.  fhTstPat: LONGINT;                                    {test pattern}
  126.  fhReserved: SignedByte;                            {reserved}
  127.  fhByteLanes: SignedByte;                            {ByteLanes}
  128.  END;
  129.  
  130. SEBlock = PACKED RECORD
  131.  seSlot: SignedByte;                                {Slot number.}
  132.  sesRsrcId: SignedByte;                                {sResource Id.}
  133.  seStatus: INTEGER;                                    {Status of code executed by sExec.}
  134.  seFlags: SignedByte;                                {Flags}
  135.  seFiller0: SignedByte;                                {Filler, must be SignedByte to align on odd boundry}
  136.  seFiller1: SignedByte;                                {Filler}
  137.  seFiller2: SignedByte;                                {Filler}
  138.  seResult: LONGINT;                                    {Result of sLoad.}
  139.  seIOFileName: LONGINT;                                {Pointer to IOFile name.}
  140.  seDevice: SignedByte;                                {Which device to read from.}
  141.  sePartition: SignedByte;                            {The partition.}
  142.  seOSType: SignedByte;                                {Type of OS.}
  143.  seReserved: SignedByte;                            {Reserved field.}
  144.  seRefNum: SignedByte;                                {RefNum of the driver.}
  145.  seNumDevices: SignedByte;                            { Number of devices to load.}
  146.  seBootState: SignedByte;                            {State of StartBoot code.}
  147.  END;
  148.  
  149.  
  150.  
  151. {  Principle  }
  152. FUNCTION SReadByte(spBlkPtr: SpBlockPtr): OSErr;
  153.  INLINE $205F,$7000,$A06E,$3E80;
  154. FUNCTION SReadWord(spBlkPtr: SpBlockPtr): OSErr;
  155.  INLINE $205F,$7001,$A06E,$3E80;
  156. FUNCTION SReadLong(spBlkPtr: SpBlockPtr): OSErr;
  157.  INLINE $205F,$7002,$A06E,$3E80;
  158. FUNCTION SGetCString(spBlkPtr: SpBlockPtr): OSErr;
  159.  INLINE $205F,$7003,$A06E,$3E80;
  160. FUNCTION SGetBlock(spBlkPtr: SpBlockPtr): OSErr;
  161.  INLINE $205F,$7005,$A06E,$3E80;
  162. FUNCTION SFindStruct(spBlkPtr: SpBlockPtr): OSErr;
  163.  INLINE $205F,$7006,$A06E,$3E80;
  164. FUNCTION SReadStruct(spBlkPtr: SpBlockPtr): OSErr;
  165.  INLINE $205F,$7007,$A06E,$3E80;
  166.  
  167.  
  168. {  Special  }
  169. FUNCTION SReadInfo(spBlkPtr: SpBlockPtr): OSErr;
  170.  INLINE $205F,$7010,$A06E,$3E80;
  171. FUNCTION SReadPRAMRec(spBlkPtr: SpBlockPtr): OSErr;
  172.  INLINE $205F,$7011,$A06E,$3E80;
  173. FUNCTION SPutPRAMRec(spBlkPtr: SpBlockPtr): OSErr;
  174.  INLINE $205F,$7012,$A06E,$3E80;
  175. FUNCTION SReadFHeader(spBlkPtr: SpBlockPtr): OSErr;
  176.  INLINE $205F,$7013,$A06E,$3E80;
  177. FUNCTION SNextSRsrc(spBlkPtr: SpBlockPtr): OSErr;
  178.  INLINE $205F,$7014,$A06E,$3E80;
  179. FUNCTION SNextTypeSRsrc(spBlkPtr: SpBlockPtr): OSErr;
  180.  INLINE $205F,$7015,$A06E,$3E80;
  181. FUNCTION SRsrcInfo(spBlkPtr: SpBlockPtr): OSErr;
  182.  INLINE $205F,$7016,$A06E,$3E80;
  183. FUNCTION SCkCardStat(spBlkPtr: SpBlockPtr): OSErr;
  184.  INLINE $205F,$7018,$A06E,$3E80;
  185. FUNCTION SReadDrvrName(spBlkPtr: SpBlockPtr): OSErr;
  186.  INLINE $205F,$7019,$A06E,$3E80;
  187. FUNCTION SFindDevBase(spBlkPtr: SpBlockPtr): OSErr;
  188.  INLINE $205F,$701B,$A06E,$3E80;
  189. FUNCTION SFindBigDevBase(spBlkPtr: SpBlockPtr): OSErr;
  190.  INLINE $205F,$701C,$A06E,$3E80;
  191.  
  192.  
  193. {  Advanced  }
  194. FUNCTION InitSDeclMgr(spBlkPtr: SpBlockPtr): OSErr;
  195.  INLINE $205F,$7020,$A06E,$3E80;
  196. FUNCTION SPrimaryInit(spBlkPtr: SpBlockPtr): OSErr;
  197.  INLINE $205F,$7021,$A06E,$3E80;
  198. FUNCTION SCardChanged(spBlkPtr: SpBlockPtr): OSErr;
  199.  INLINE $205F,$7022,$A06E,$3E80;
  200. FUNCTION SExec(spBlkPtr: SpBlockPtr): OSErr;
  201.  INLINE $205F,$7023,$A06E,$3E80;
  202. FUNCTION SOffsetData(spBlkPtr: SpBlockPtr): OSErr;
  203.  INLINE $205F,$7024,$A06E,$3E80;
  204. FUNCTION SInitPRAMRecs(spBlkPtr: SpBlockPtr): OSErr;
  205.  INLINE $205F,$7025,$A06E,$3E80;
  206. FUNCTION SReadPBSize(spBlkPtr: SpBlockPtr): OSErr;
  207.  INLINE $205F,$7026,$A06E,$3E80;
  208. FUNCTION SCalcStep(spBlkPtr: SpBlockPtr): OSErr;
  209.  INLINE $205F,$7028,$A06E,$3E80;
  210. FUNCTION SInitSRsrcTable(spBlkPtr: SpBlockPtr): OSErr;
  211.  INLINE $205F,$7029,$A06E,$3E80;
  212. FUNCTION SSearchSRT(spBlkPtr: SpBlockPtr): OSErr;
  213.  INLINE $205F,$702A,$A06E,$3E80;
  214. FUNCTION SUpdateSRT(spBlkPtr: SpBlockPtr): OSErr;
  215.  INLINE $205F,$702B,$A06E,$3E80;
  216. FUNCTION SCalcSPointer(spBlkPtr: SpBlockPtr): OSErr;
  217.  INLINE $205F,$702C,$A06E,$3E80;
  218. FUNCTION SGetDriver(spBlkPtr: SpBlockPtr): OSErr;
  219.  INLINE $205F,$702D,$A06E,$3E80;
  220. FUNCTION SPtrToSlot(spBlkPtr: SpBlockPtr): OSErr;
  221.  INLINE $205F,$702E,$A06E,$3E80;
  222. FUNCTION SFindSInfoRecPtr(spBlkPtr: SpBlockPtr): OSErr;
  223.  INLINE $205F,$702F,$A06E,$3E80;
  224. FUNCTION SFindSRsrcPtr(spBlkPtr: SpBlockPtr): OSErr;
  225.  INLINE $205F,$7030,$A06E,$3E80;
  226. FUNCTION SDeleteSRTRec(spBlkPtr: SpBlockPtr): OSErr;
  227.  INLINE $205F,$7031,$A06E,$3E80;
  228.  
  229. FUNCTION OpenSlot(paramBlock: ParmBlkPtr;async: BOOLEAN): OSErr;
  230. FUNCTION OpenSlotSync(paramBlock: ParmBlkPtr): OSErr;
  231.  INLINE $205F,$A200,$3E80;
  232. FUNCTION OpenSlotAsync(paramBlock: ParmBlkPtr): OSErr;
  233.  INLINE $205F,$A600,$3E80;
  234.  
  235.  
  236. {  Device Manager Slot Support  }
  237. FUNCTION SIntInstall(sIntQElemPtr: SQElemPtr;theSlot: INTEGER): OSErr;
  238.  INLINE $301F,$205F,$A075,$3E80;
  239. FUNCTION SIntRemove(sIntQElemPtr: SQElemPtr;theSlot: INTEGER): OSErr;
  240.  INLINE $301F,$205F,$A076,$3E80;
  241.  
  242. FUNCTION SVersion(spBlkPtr: SpBlockPtr): OSErr;
  243.  INLINE $205F,$7008,$A06E,$3E80;
  244. FUNCTION SetSRsrcState(spBlkPtr: SpBlockPtr): OSErr;
  245.  INLINE $205F,$7009,$A06E,$3E80;
  246. FUNCTION InsertSRTRec(spBlkPtr: SpBlockPtr): OSErr;
  247.  INLINE $205F,$700A,$A06E,$3E80;
  248. FUNCTION SGetSRsrc(spBlkPtr: SpBlockPtr): OSErr;
  249.  INLINE $205F,$700B,$A06E,$3E80;
  250. FUNCTION SGetTypeSRsrc(spBlkPtr: SpBlockPtr): OSErr;
  251.  INLINE $205F,$700C,$A06E,$3E80;
  252. FUNCTION SGetSRsrcPtr(spBlkPtr: SpBlockPtr): OSErr;
  253.  INLINE $205F,$701D,$A06E,$3E80;
  254.  
  255.  
  256. {$ENDC} { UsingSlots }
  257.  
  258. {$IFC NOT UsingIncludes}
  259.  END.
  260. {$ENDC}
  261.  
  262.